@@ -3,6 +3,16 @@ require 'whois' |
||
| 3 | 3 |
require 'haml' |
| 4 | 4 |
require 'json' |
| 5 | 5 |
|
| 6 |
+helpers do |
|
| 7 |
+ |
|
| 8 |
+ def cache_for(mins = 1) |
|
| 9 |
+ if settings.environment != :development |
|
| 10 |
+ response['Cache-Control'] = "public, max-age=#{60*mins}"
|
|
| 11 |
+ end |
|
| 12 |
+ end |
|
| 13 |
+ |
|
| 14 |
+end |
|
| 15 |
+ |
|
| 6 | 16 |
get '/' do |
| 7 | 17 |
haml :index |
| 8 | 18 |
end |
@@ -19,11 +29,10 @@ get '/lookup' do |
||
| 19 | 29 |
"expires_on" => @lookup_info.expires_on, |
| 20 | 30 |
"whois_server" => @lookup_info.referral_whois, |
| 21 | 31 |
"nameservers" => @lookup_info.nameservers, |
| 22 |
- "admin_contacts" => @lookup_info.admin_contacts, |
|
| 32 |
+ "admin_contacts" => @lookup_info.admin_contacts[0], |
|
| 23 | 33 |
"techical_contacts" => @lookup_info.technical_contacts, |
| 24 | 34 |
"detailed" => @lookup_info.to_s.gsub(/\n/, '<br>') |
| 25 | 35 |
} |
| 26 |
- puts @lookup_info.admin_contacts |
|
| 27 | 36 |
haml :lookup |
| 28 | 37 |
end |
| 29 | 38 |
|
@@ -35,8 +44,8 @@ get '/lookup.json' do |
||
| 35 | 44 |
:expires_on => @lookup_info.expires_on, |
| 36 | 45 |
:whois_server => @lookup_info.referral_whois, |
| 37 | 46 |
:nameservers => @lookup_info.nameservers, |
| 38 |
- :admin_contacts => @lookup_info.admin_contacts, |
|
| 39 |
- :techical_contacts => @lookup_info.technical_contacts, |
|
| 47 |
+ :admin_contacts => @lookup_info.admin_contacts[0], |
|
| 48 |
+ :techical_contacts => @lookup_info.technical_contacts[0], |
|
| 40 | 49 |
:detailed => @lookup_info |
| 41 | 50 |
}.to_json |
| 42 | 51 |
end |
@@ -10,11 +10,19 @@ |
||
| 10 | 10 |
|
| 11 | 11 |
%h3 Admin Contact |
| 12 | 12 |
%div{:style => "border: solid 1px black; padding: 10px; border-radius: 15px"}
|
| 13 |
- = @formatted_response["admin_contacts"] |
|
| 13 |
+ - if @formatted_response["admin_contacts"] |
|
| 14 |
+ - @formatted_response["admin_contacts"].each do |contact| |
|
| 15 |
+ = contact.to_s + " <br />" |
|
| 16 |
+ - else |
|
| 17 |
+ = "none" |
|
| 14 | 18 |
|
| 15 | 19 |
%h3 Technical Contact |
| 16 | 20 |
%div{:style => "border: solid 1px black; padding: 10px; border-radius: 15px"}
|
| 17 |
- = @formatted_response["technical_contacts"] |
|
| 21 |
+ - if @formatted_response["technical_contacts"] |
|
| 22 |
+ - @formatted_response["technical_contacts"].each do |contact| |
|
| 23 |
+ = contact.to_s + " <br />" |
|
| 24 |
+ - else |
|
| 25 |
+ = "none" |
|
| 18 | 26 |
|
| 19 | 27 |
%h3 Create Date |
| 20 | 28 |
%div{:style => "border: solid 1px black; padding: 10px; border-radius: 15px"}
|